*** REPLICATION TOOLKIT ***

* AUTHORS: CIMINELLI DUVAL FURCERI 

* ARTICLE: EMPLOYMENT PROTECTION DEREGULATION AND LABOR SHARES IN ADVANCED ECONOMIES 

* JOURNAL: REVIEW OF ECONOMICS AND STATISTICS

* OUTPUT: TABLE D1 (ONLINE APPENDIX)

***************************

cd ""

use "DTA files/Dataset", clear

* Set excel file where to store table
putexcel set "Tables/D1", modify

egen va_country = total(va) if va != . , by(ifscode year)
gen va_share = 100*va/va_country
gen a = 100*(lab/va)
 
collapse v1=va_share v2=a v3=EOS_serv4_OLS v4=layoff_rate, by(industry)

egen id = group(industry)
sum id
local max = r(max)

matrix descriptive = J(`max',4,.)
mat rownames descriptive = 10t12 13t15 16t18 19 20t21 22t23 24t25 26t27 28 29t30 31t33 45 46 47 49t52 53 58t60 61 62t63 A B DtE F I K L MtN O P Q R S 

forvalues j = 1/4 {
forvalues i = 1/`max' {
sum v`j' if id==`i'
local mean`j' = r(mean)
sum id if id == `i'
local id = r(mean)
matrix descriptive[`i',`j'] = `mean`j''
}
}
putexcel B2=matrix(descriptive) 
